"use strict";

var parent = module.parent.exports,
  passport = require.main.require("passport"),
  nconf = require.main.require("nconf"),
  async = require.main.require("async"),
  Controllers = {};

Controllers.renderSettings = function(req, res, next) {
  parent.getUidByUserslug(req.params.userslug, function(err, uid) {
    if (uid == null) {
      return res.render("403", {});
    }

    parent.isVerified(uid, function(err, isVerified) {
      parent.get(uid, function(err, mobile) {
        res.render("account/aliyunsms", {
          isVerified,
          mobile: mobile,
          uid: uid
        });
      });
    });
  });
};

module.exports = Controllers;
